-- GENERATED SPELL FOR [Wastewander Shadow Mage] --


function spell0_5617(pUnit, Event) --@Immolate,n/a--
pUnit:FullCastSpellOnTarget(20826,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5617', 23000, 1)
end

function spell1_5617(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(20825,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5617', 3000, 1)
end

function spell2_5617(pUnit, Event) --@Summon Voidwalker,Self--
pUnit:FullCastSpellOnTarget(12746,pUnit)
pUnit:RegisterEvent('Sorts_5617', 627, 1)
end

function Sorts_5617(pUnit, Event)
local choix_sorts_5617 = math.random(0, 2)
if choix_sorts_5617 == 0 then
pUnit:RegisterEvent('spell0_5617', 1, 1)
end
if choix_sorts_5617 == 1 then
pUnit:RegisterEvent('spell1_5617', 1, 1)
end
if choix_sorts_5617 == 2 then
pUnit:RegisterEvent('spell2_5617', 1, 1)
end
end

function mob5617_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_5617', math.random(1500, 3000), 1)
end

function mob5617_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5617_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5617_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(5617, 1, 'mob5617_Action')
RegisterUnitEvent(5617, 2, 'mob5617_Leave')
RegisterUnitEvent(5617, 3, 'mob5617_Kill')
RegisterUnitEvent(5617, 4, 'mob5617_Die')
